import java.sql.SQLOutput;
import java.util.Arrays;
import java.util.Scanner;

public class arr {
//    public static void main(String[] args){
//        int num = 0;
//        int i = 1;
//        Scanner scanner = new Scanner(System.in);
//        while(i <= 10){
//            System.out.println("请输入第"+i+"个数据（1-100）:>");
//            num = scanner.nextInt();
//            if(num > 100){
//                System.out.println("您输入的数据范围不在1-100，请重新输入");
//                continue;
//            }
//            ++i;
//        }
//    }
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        String ret = myString(arr);
        System.out.println(ret);

        doubleArr(arr);
    }
    public static String myString(int[] array){
        if(array == null){
            return null;
        }
        if(array.length == 0){
            return "[]";
        }
        String ret = "[";
        for (int i = 0; i < array.length; i++) {
            if(i != array.length-1){
                ret = ret + array[i] + ", ";
            }else {
                ret += array[i] + "]";
            }
        }
        return ret;
    }
    public static void doubleArr(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] = arr[i] * 2;
        }
        System.out.println(Arrays.toString(arr));
    }
}
